{% extends "projects/base_project.html" %}

{% load crispy_forms_tags %}
{% load i18n %}
{% load privacy_tags %}

{% block title %}{{ version.slug }} - {{ version.project.name }}{% endblock %}


{% block project_editing %}
    {% with versions_active="active" %}
        {% include "core/project_bar.html" %}
    {% endwith %}
{% endblock %}

{% block content-header %}<h1>{% blocktrans with version.name as version_name %}{{ version_name }}{% endblocktrans %}</h1>{% endblock %}

{% block content %}
    <h2> Editing {{ version.slug }} </h2>

    {% if request.user|is_admin:project %}
      {% if not version.active and version.built %}
        <form name="version_delete_html" method="post" action="{% url "project_version_delete_html" project.slug version.slug %}">
          {% csrf_token %}
        </form>
        <p class="empty">
          {# We are submitting the form using javascript because it breaks the UI design if we use buttons #}
          {% blocktrans trimmed %}
            This version is inactive but its documentation is still available online.
            You can <a href="#" onclick="document.forms['version_delete_html'].submit();">delete this version's documentation</a> if you want to remove it completely.
          {% endblocktrans %}
        </p>
      {% endif %}
    {% endif %}

    {% crispy form %}

{% endblock %}
